-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NU-1928] Fix special case for spel toMap extension #7329
base: staging
Are you sure you want to change the base?
[NU-1928] Fix special case for spel toMap extension #7329
Conversation
case m: JMap[_, _] => m.keySet().containsAll(keyAndValueNames) | ||
case _ => false | ||
case m: JMap[_, _] => m.keySet().containsAll(keyAndValueNames) | ||
case _: java.util.Map.Entry[_, _] => true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
java.util.Map.Entry
-> JMap.Entry
?
val map = new JHashMap[Any, Any]() | ||
c.forEach { | ||
case e: JMap[_, _] => map.put(e.get(keyName), e.get(valueName)) | ||
case e: java.util.Map.Entry[_, _] => map.put(e.getKey, e.getValue) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if e
is not matched?
@@ -1663,6 +1663,42 @@ class SpelExpressionSpec extends AnyFunSuite with Matchers with ValidatedValuesD | |||
} | |||
} | |||
|
|||
test("should convert list of map entries into map") { | |||
// this is a special case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove these comments because it's says only that we didn't handle sth in the past and now test proves that we handle this situation
Describe your changes
Checklist before merge